package com.wcs.exam.controller.admin;

import com.wcs.exam.common.base.Result;
import com.wcs.exam.controller.admin.biz.AdminLoginBiz;
import com.wcs.exam.controller.admin.req.AdminSysUserLoginReq;
import com.wcs.exam.controller.admin.resp.AdminSysUserLoginResp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotNull;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wcs
 */
@Tag(name = "Admin-登录")
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1/admin/login")
public class AdminLoginController {

    @NotNull
    private final AdminLoginBiz biz;

    @Operation(summary = "密码登录")
    @PostMapping(value = "/password")
    public Result<AdminSysUserLoginResp> login(@RequestBody AdminSysUserLoginReq req) {
        return biz.login(req);
    }

}
